package com.dxy.controller;

import com.dxy.bean.MenoBean;
import com.dxy.bean.RemindBean;
import com.dxy.serviceImpI.RemindServiceImpI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

@Controller
@RequestMapping("/reminder")
public class RemindController {
    //将Service 注入Web层
    @Autowired
    private RemindServiceImpI remindServiceImpI;

    @RequestMapping(value = "/saveremind", method = RequestMethod.GET)
    @ResponseBody
    public int saveremind(RemindBean remindBean) {
        return remindServiceImpI.saveRemindMessages(remindBean);
    }

    @RequestMapping(value = "/getremind", method = RequestMethod.GET)
    @ResponseBody
    public RemindBean getRemindertime(int meno_id) {
        return remindServiceImpI.getTimeMessages(meno_id);
    }

    @RequestMapping(value = "/deleteremind", method = RequestMethod.GET)
    @ResponseBody
    public int deleteremind(int meno_id) {
        return remindServiceImpI.deleteRemindMessages(meno_id);
    }
    @RequestMapping(value = "/selectAllremind")
    @ResponseBody
    public List<RemindBean> listtime() {
        return remindServiceImpI.getAllTimeMessages();
    }
//    @RequestMapping(value = "/checkReminderExist", method = RequestMethod.GET)
//    @ResponseBody
//    public int checkremind(int meno_id) {
//        return remindServiceImpI.checkRemindMessages(meno_id);
//    }
}
